package com.cskaoyan.day03.generic3;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 4 → four → for → stone4j
 * log4j
 * @author stone
 * @date 2022/01/29 10:48
 */
public class String2DateTypeConverter implements TypeConverter<String, Date>{
    @Override
    public Date convert(String orign) {
        Date parse = null;
        try {
            parse = new SimpleDateFormat("yyyy-MM-dd").parse(orign);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return parse;
    }
}
